package com.shujia.MR.partitions;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;


public class PartitionMapper extends Mapper<LongWritable, Text, Text, Student> {

    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, Student>.Context context) throws IOException, InterruptedException {
        String[] columns = value.toString().split(",");
        context.write(new Text(columns[0]), new Student(columns[0], columns[1], columns[2], columns[3], columns[4]));
    }
}
